import request from '@/utils/request'
const prefix = '/gift/api/order'

/**
 * 提交订单
 * @returns
 */
const postOrder = (data) => {
	return request({
		url: prefix + '/post',
		method: 'post',
		data
	})
}
const isPaySuccess = (orderNo) => {
	return request({
		url: prefix + '/isPaySuccess/' + orderNo,
		method: 'get',
	})
}
/**
 * 取消订单
 * @param {*} orderNo
 */
const cancel = (orderNo) => {
	return request({
		url: prefix + '/cancel/' + orderNo,
		method: 'post',
	})
}

 const getOrderInfo = (orderNo) => {
	return request({
		url: prefix + '/info/' + orderNo,
		method: 'get',
	})
}
export default {
	postOrder,
	isPaySuccess,
	cancel,
	getOrderInfo
}